﻿using BL_Client.ServiceReference1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security;

namespace UI
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        static BL_Client.IBL bl;

        public Admin()
        {
            bl = new BL_Client.BL();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            User user = bl.GetUserByEmail(Page.User.Identity.Name);

            if (user != null)
                Registration.InnerHtml = @"Hello, <span id=""Name"">" + user.LastName + " " + user.FirstName + @"</span>
                                            <a href=""Logout.aspx"">Sign out</a>";
            else
                Registration.InnerHtml = @"Hello, you must login before accessing any pages";
        }
    }
}